package com.yaozheng.vocationaltraining.view;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;
import org.json.JSONObject;

import com.yaozheng.vocationaltraining.R;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * 积分类型
 * 
 * @author Administrator
 * 
 */
@EViewGroup(R.layout.item_integral_type_list)
public class IntegralTypeListItemView extends LinearLayout {
	@ViewById
	TextView itemIntegralTypeFractionText, itemIntegralTypeNameText;

	public IntegralTypeListItemView(Context context, AttributeSet attrs,
			int defStyleAttr) {
		super(context, attrs, defStyleAttr);
		// TODO Auto-generated constructor stub
	}

	public IntegralTypeListItemView(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
	}

	public IntegralTypeListItemView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
	}

	/**
	 * 加载数据
	 * 
	 * @param position
	 * @param itemJsonObject
	 */
	public void loadData(int position, JSONObject itemJsonObject) {
		itemIntegralTypeNameText.setText(itemJsonObject.optString("typeName",
				""));
		itemIntegralTypeFractionText.setText(itemJsonObject
				.optString("typeFraction"));

	}

}
